package cn.hiapi.shopkeeper.entity.activity;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import cn.hiapi.shopkeeper.entity.order.ActivityCardOrder;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author AdinZ
 * @date 2023/1/1 22:53
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_code_record")
@ApiModel(description = "核销码记录")
@Getter
@Setter
public class ActivityCodeRecord extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("活动id")
    private long aid;
    @ApiModelProperty("店铺id")
    private long shopId;
    @ApiModelProperty("订单id")
    private long oid;

    private long uid;

    /**
     * {@link ActivityCardOrder#getId()}
     */
    @ApiModelProperty("次卡订单id")
    private long cardId;

    @ApiModelProperty("验证码")
    private String code;


    @ApiModelProperty("核销码状态,0 待使用,1已使用,3作废(转移给了他人,本卡作废),")
    private int status;


    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();

}
